
<template>
  <div id="cart">
    <nav-bar style="background-color: #ff5777;color: white;font-weight: 700">
      <div slot="center">购物车({{cartLength}})</div>
    </nav-bar>
    <scroll class="content" ref="scroll">
      <cart-list></cart-list>
    </scroll>
    <cart-bottom></cart-bottom>

  </div>
</template>
<script>
  import NavBar from "../../components/common/navbar/NavBar";
  import {mapGetters} from 'vuex'
  import CartList from "./childComps/CartList";
  import Scroll from "../../components/common/scroll/Scroll";
  import {itemListenerMixin} from "../../common/mixin";
  import CartBottom from "./childComps/CartBottom";

  export default {
    name: "Cart",
    data() {
      return {};
    },
    mixins:[itemListenerMixin],
    components: {CartBottom, Scroll, CartList, NavBar},
    computed: {
      ...mapGetters(['cartLength','cartList'])
    },
    activated() {
      this.$refs.scroll.refresh();
    }
  };
</script>
<style scoped>
  #cart {
    position: relative;
    height: 100vh;
  }

  .content {
    height: calc(100% - 44px - 49px - 45px);
    overflow: hidden;
  }

</style>